﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VoteResult.aspx.cs" Inherits="Hxsoft.AppV1.Admin.VoteManage.VoteResult" %>
<%@ Import Namespace="Hxsoft" %>

<%@ Register Src="~/Controls/ListBox_FootBox.ascx" TagName="ListBox_FootBox" TagPrefix="uc" %>
<%@ Register Src="~/Controls/ListBox_HeadBox.ascx" TagName="ListBox_HeadBox" TagPrefix="uc" %>
<%@ Register Src="Controls/ManageNavigation.ascx" TagName="ManageNavigation" TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title>[ 调查结果 ]</title>
	<script type="text/javascript" src="<%# ResolveUrl("~/J/List.js") %>"></script>
	<script type="text/javascript">
		function Init() {
			var box = $("#AwardBox");
			var handle = box.find(".close");
			handle.click(function() { box.css("display", "none"); });
		}
		
		function setAward(obj, id, isAward, content) {
			var box = $("#AwardBox");

			var ctrResultId = $("#<%# CtrlResultId.ClientID %>");
			var ctrIsAward = $("#<%# CtrlIsAward.ClientID %>");
			var ctrAwardContent = $("#<%# CtrlAwardContent.ClientID %>");

			ctrResultId.val(id);
			ctrIsAward.attr("checked", isAward == true);
			ctrAwardContent.val(content);

			var tirgger = $(obj);
			box.css("left", (tirgger.offset().left + tirgger.width()) + "px");
			box.css("top", tirgger.offset().top + "px");
			box.css("display", "block");
		}
	</script>
</head>
<body>
	<form id="form1" runat="server">
		<asp:ScriptManager ID="ScriptManager1" runat="server">
			</asp:ScriptManager>
		<div id="MainBody" runat="server" class="FormBody">
			<div class="FormTablesBox">
			<uc:ManageNavigation ID="ManageNavigation1" CurrentKey="VoteResult" VoteID="<%# Identifier %>" runat="server" />
			当前位置: 管理中心 →[<%= SiteName %><%= CompanyId.HasValue ? "→" + CompanyName : ""%>] 调查结果 
			<uc:ListBox_HeadBox ID="ListBox_HeadBox1" runat="server" />
			<Hxctr:Vote ViewType="VoteView" VoteContent="<%# VoteContent %>" EnableViewState="false" runat="server" />
			<div class="ListBoxItem">
				<table id="ToolBarBox" cellspacing="0" width="100%">
					<tr>
						<td class="LevelCompart" align="right">                            
							
						</td>
					</tr>
					<tr>
						<td id="Foot">
							自定义内容:<asp:DropDownList ID="DdlHasUserDefinedContent" runat="server">
								<asp:ListItem Value="">-请选择-</asp:ListItem>
								<asp:ListItem Value="true">有</asp:ListItem>
								<asp:ListItem Value="false">无</asp:ListItem>
							</asp:DropDownList>
							关键字:<asp:TextBox ID="TbKeyword" runat="server"></asp:TextBox>
							<asp:Button ID="BtSearch" runat="server" Text="搜索" OnClick="BtSearch_Click" />
							|
							<asp:Button ID="BtReload" runat="server" Text="刷新" OnClick="BtReload_Click" /></td>
					</tr>
				</table>
			</div>
			<div class="ListBoxItem">
				<asp:UpdatePanel ID="UpdatePanel1" runat="server">
					<ContentTemplate>
				<table id="ListBox" cellspacing="0" width="100%">
					<tbody>
						<tr>
							<td class="LevelCompart">
								<asp:Repeater ID="List" runat="server">
									<HeaderTemplate>
										<table id="List" cellspacing="1" cellpadding="2" width="100%">
											<tr id="Title">
												<th width="40">
													ID</th>
												<th>
													选择项</th>																																				
												<th>
													自定义内容</th>
												<th width="120">
													IP</th>
												<th>
													用户</th>
												<th>姓名</th>
												<th width="30">获奖</th>
												<th>电话</th>
												<th width="120">
													日期</th>
											</tr>
									</HeaderTemplate>
									<ItemTemplate>
										<tr class="mouseout" align="center" onmouseover="listItem_mouseOver(this);" onmouseout="listItem_mouseOut(this);">
											<td>
												<%# Eval("ResultId")%>
											</td>
											<td align="left">
												<%# Eval("SelectedItems")%>
											</td>
											<td>
												<%# Eval("UserDefinedContent")%>
											</td>
											<td>
												<%# Eval("Ip")%>
											</td>
											<td><%# Eval("UserName") %></td>
											<td><%# Eval("Name") %></td>
											<td>
												<a href="javascript:void(0);" onclick="setAward(this, <%# Eval("ResultId")%>, <%# Eval("IsAward", null).ToLower()%>, '<%# Eval("AwardContent", null).ToJavascriptString()%>');">
													<%# (bool)Eval("IsAward") == true ? "是" : "<span class=\"Emphasize\">否</span>"%>
												</a>
											</td>
											<td><%# Eval("Telephone") %></td>
											<td>
												<%# Eval("VoteDate")%>
											</td>
										</tr>
									</ItemTemplate>
									<FooterTemplate>
										</table>
									</FooterTemplate>
								</asp:Repeater>
							</td>
						</tr>
						<tr>
							<td id="Td1" align="right">
								<Hxctr:AspNetPager ID="pager" runat="server" AlwaysShow="True" OnPageChanging="pager_PageChanging" CustomInfoSectionWidth="" CustomInfoText="" PageSize="20" ShowCustomInfoSection="Left">
								</Hxctr:AspNetPager>
							</td>
						</tr>
					</tbody>
				</table>
				<div id="AwardBox" class="ShowListDiv" style="min-height:20px;width:auto;display:none;">
					<div class="InputDivHeader">
						<h6 style="border-bottom: 1px solid #ccc;">
							<img class="close" alt="关闭" src="../I/del.gif">
							<span id="SetCompanyName">设置获奖信息</span>
						</h6>
					</div>
					<asp:HiddenField ID="CtrlResultId" runat="server" />
					<asp:CheckBox ID="CtrlIsAward" Text="获奖" runat="server" />
					<asp:TextBox ID="CtrlAwardContent" runat="server"></asp:TextBox>
					<asp:Button Text="确定" ID="CtrSubmit" runat="server" onclick="CtrSubmit_Click" />
				</div>
				<asp:Literal ID="Literal1" runat="server"></asp:Literal>
					</ContentTemplate>
					<Triggers>
						<asp:AsyncPostBackTrigger ControlID="BtReload" EventName="Click" />
						<asp:AsyncPostBackTrigger ControlID="BtSearch" EventName="Click" />
					</Triggers>
				</asp:UpdatePanel>
			</div>
			<uc:ListBox_FootBox ID="ListBox_FootBox1" runat="server" />
			</div>
		</div>
		<Hxctr:MessageBox ID="MessageBox1" runat="server" />
		<Hxctr:UpdateProgress ID="UpdateProgress1" runat="server" />
	</form>
</body>
</html>